<?php
/*
	提现
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
global $_RQ;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
if($_RQ['op']=='get'){
	$return['list']=array();
	$return['params']['isnomy']=0;
	set_html('title','红娘中心');
	exi($return);
}
// js 获取数据
if($_RQ['op']=='getlist'){
	$member=$this->model('member')->get_member();
	$params=array('uniacid'=>$_SESSION['uniacid'],'status'=>1);
	if(!$_RQ['isnomy']){
		$params['id']=$member['worker_id'];
	}else{
		$params['id <>']=$member['worker_id'];
	}
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$total='';
	$list=pdo_getslice('jy_xiangqin_worker',$params,array($pindex,$psize),$total,$fields,'','createtime desc');
	foreach($list as &$item){
		$item['lat_lng']=json_decode($item['lat_lng'],true);
		$item['pcd']=json_decode($item['pcd'],true);
		//按点赞数排序作品
		$pindex = max(1, 0);
		$psize = 10;
		$members=pdo_getslice('jy_xiangqin_member',array('uniacid'=>$_SESSION['uniacid'],'worker_id'=>$item['id']),array($pindex,$psize),$total,array('mid'),'','id desc');
		foreach($members as &$mv){
			$memberinfo=$this->model('member')->get_member($mv['mid']);
			$mv['nickname']=$memberinfo['nickname'];
			$mv['avatar']=$memberinfo['avatar'];
		}
		$item['members']=$members;	
		$item['fuwutitle']=pdo_getcolumn('jy_xiangqin_fuwu',array('id'=>$item['fuwuid'],'uniacid'=>$_SESSION['uniacid']),'title')?:'无';
	}
	$return['list']=$list;
	exi($return);
}